1. Field of the Invention
The present invention relates to a pulse input apparatus for inputting to a central processing unit the time data representing the time at which an external signal has changed.
An automatic control system is used in, for example, an automobile, for controlling the various components of the automobile in accordance with the items of data representing the operation conditions of these components which vary with time. More specifically, the sensors provided in the automobile detect the operation conditions of the components and generate the signals representing these conditions. Hence, when the operation conditions of the components change, the signals output by the sensors also change. The items of time data, which represent the times at which the operation conditions change, are input to the central processing unit of the automatic control system. A pulse input apparatus is used to input such time data items to the central processing unit. Pulse input apparatuses are used in various control systems designed to control a variety of machines.
2. Description of the Related Art
Such a pulse input apparatus is disclosed, in, for example, U.S. Pat. No. 4,222,103. As is shown in FIG. 23, this apparatus comprises timer counter 1203 and registers 1204 to 1209. Timer counter 1203 measures time and outputs data representing the present time. Registers 1204 to 1209 are used to store the items of data representing the times at which the signals input to the apparatus have changed. More precisely, each of these registers stores the time data which timer counter 1203 outputs the moment the register receives a trigger signal generated when the signal input to the apparatus changes. Each register can store such time data, without any interrupt of the computer program running for the automatic control of a machine. For instance, when data "0100", which represents that the input signal has changed, is stored into another register 1210, logic gates 1212 to 1219 perform logic operations on this data and the input signal, whereby trigger signals are supplied to registers 1204 to 1209 at the times when the input signal has its level changed, as is illustrated in FIG. 24. In response to the trigger signals, each of registers 1204 to 1209 stores and holds the count value of timer counter 1203. The data representing the number of the channel, in which the input signal has been transmitted, is stored in register 1211.
The operation of the pulse input apparatus will be explained in greater detail, with reference to the flow chart of FIG. 25. A sequence of operations is repeated for each channel, in response to an interrupt signal. The sequence consists of the analyzing of an interrupt factor, the reading of the time, the setting of the next interrupt factor, and the waiting for the next interrupt. More specifically, in operation sequence 1, the interrupt factors for all channels are set, such that all channels wait for an interrupt signal. In operation sequence 2, when an interrupt signal is generated, the interrupt factor is analyzed, and the time, at which the input signal transmitted in the first channel has changed, is read out from register 1206, and finally the next interrupt factor is set to "0". Then, the channel identified by the interrupt factor this set waits for an interrupt signal. Five other sequences of similar operations are performed, thereby the data items representing the times, at which the input signals transmitted in the other five channels have changed, are read out from registers 104, 105, 107, 108, and 109. To perform these similar sequences of operations, the central processing unit must repeatedly wait for an interrupt signal and set a next interrupt factor. The pulse input apparatus disclosed in U.S. Pat. No. 4,222,103 can record only one data item representing the time at which the input signal transmitted in each channel has changed. Therefore, when the input signal has a complex waveform, the central processing unit is interrupted frequently. As a consequence, the load on the central processing unit increases, and the ability of the control system as a whole decreases.
Another type of a pulse input apparatus is disclosed in U.S. Pat. No. 4,259,719 and U.S. Pat. No. 4,283,761. This pulse input apparatus has an FIFO (First-In, First-Out) stack. A trigger signal is generated when it is detected that the input signal changes. In response to the trigger signal, both the data representing the present time and the data representing the change in the operation condition of a device. The data items representative of the changes of the operation condition are stored in the FIFO stack in the order in which the condition changes have occurred. Assuming that the first data representing a phase difference and the second data representing the pulse width related to the phase difference, are stored in the FIFO stack, then it is necessary to read all data items from the FIFO stack to search for the second data in accordance with the first data. Further, it is necessary to execute an analysis routine for reading all data items from the FIFO stack and then classifying the data items thus read out from the FIFO stack. Hence, the central processing unit, to which the pulse input apparatus inputs the time data items, must perform all operations required for determining the time of any change in the operation condition, based on the data items stored into the FIFO stack.
As has been pointed out, when the conventional pulse input apparatus is used to input time data items to a central processing unit so that this unit determine the complex-wave-form of a signal representing the changes in the operation condition of a device, the central processing unit must be interrupted frequently, or must execute an analysis routine. Obviously, the work load on the central processing unit is great, and the ability of the automatic control system employing the central processing unit is inevitably limited.